package com.kehongborui;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexDemo {
    public static void main(String[] args) {
        String reg = "[\\d]{4,12}@\\w+.(com|cn|net)";  // 111@aaa.aaa
        Pattern pattern = Pattern.compile(reg);  // 获取pattern 实例
        Matcher matcher = pattern.matcher("12216@aabcddddg.a");  // 返回的是比较器
        System.out.println(matcher.matches());
    }
}
